<?php
session_start();
require_once '../Miffos/Library/User.php';
require_once '../Miffos/Library/Session.php';

echo "<h1>Testing class: User</h1>";
/**
 * Experiment with class User
 */  

/**
 * Create Instance
 */ 
echo "<h2>Simple Authorizition User</h2>\n";
$instance = User::getInstance();
$instance->authorization("Jack");
var_dump($instance->isAuthorization());
$instance->logout();
var_dump($instance->isAuthorization());
echo "<br />";
/**
 * Create Role and authorization Jack to Admin role
 */
echo "<h2>Create trustee rights user</h2>";
$user = new User();
$user->addRole("admin");
$user->allow("admin",array("edit","new"));
$user->addRole("guest");
$user->allow("guest","view");
$user->authorization("Jack");
$user->addRole("admin");

?>